import React, { Component } from 'react';

import { withRouter,NavLink} from 'react-router-dom';
import {observer,inject} from 'mobx-react';

// 目录文件: views/NewStore（你的页面文件夹）/index.jsx

@withRouter
@inject('first','two','newStore')
@observer
class View extends Component {
    constructor(props){
        super(props);
        this.state = {

        }
    }
    hdFn(e,text){
        const { setName, } = this.props.newStore;
        // console.log(text)
        setName(text);
    }
    hdGetFn(){
        const { getFn, } = this.props.newStore;
        getFn();
    }
    componentDidMount(){
        this.hdGetFn();
    }
    render(){
        console.log()
        const { name } = this.props.newStore;
        const lists = this.props.newStore.baseInfo.map((val,index)=>{
            return(
                <li key={val.id}>1111</li>
            )
        })
        return(
            <div>
            <NavLink to="/storepage">storepage</NavLink><br/>
            <NavLink to="/newstore">newstore</NavLink><br/>
                asdsafd
                <br/>他的名字是 ：{name}
                <br/><input type="button"
                onClick =
                {(e)=>{this.hdFn(e,'ajax值')}}
                value="更换名字"/>
                {lists}
            </div>
        )
    }
}







export default View;
